#ifndef NEOBICALIBROPRIVATE_H
#define NEOBICALIBROPRIVATE_H

#include "stdafx.h"
#include <QPainter>

class NeoBiCalibro;
class NeoBiCalibroPrivate : public QObject
{
    Q_OBJECT
    NEO_PRIVATE_CREATE(NeoBiCalibro)
    NEO_PRIVATE_PROPERTY_CREATE_H(int, Value)
    NEO_PRIVATE_PROPERTY_CREATE_H(int, TickInterval)
    NEO_PRIVATE_PROPERTY_CREATE_H(int, MajorTickInterval)
    NEO_PRIVATE_PROPERTY_CREATE_H(int, TextTickInterval)
    NEO_PRIVATE_PROPERTY_CREATE_H(int, MinAngle)
    NEO_PRIVATE_PROPERTY_CREATE_H(int, MaxAngle)
    NEO_PRIVATE_PROPERTY_CREATE_H(bool, ShowNotches)
    NEO_PRIVATE_PROPERTY_CREATE_H(bool, ShowMarkers)
    NEO_PRIVATE_PROPERTY_CREATE_H(QColor, PointerColor)
    NEO_PRIVATE_PROPERTY_CREATE_H(QColor, BackgroundColor)
    NEO_PRIVATE_PROPERTY_CREATE_H(QColor, NotchColor)
    NEO_PRIVATE_PROPERTY_CREATE_H(QColor, MarkerColor)

public:
    NeoBiCalibroPrivate(QObject *parent = nullptr);
    ~NeoBiCalibroPrivate();

    int realAngleToVirtualAngle(int angle);
    int virtualAngleToRealAngle(int angle);
    int mousePositionForAngle(QPointF pos);
    void updateWidgetGeometry(QSize size);

    void drawBackground(QPainter *painter);
    void drawNotches(QPainter *painter);
    void drawPointer(QPainter *painter);
    void drawMarks(QPainter *painter);

private:
    const int pSpace{10};
    const int pMinSpinAngle{10};
    const int pMaxSpinAngle{360};

    int pIndicatorRadius;
    QPointF pCircleCenter;
    int pCurrentSpinAngle;
};

#endif